package process_demo.timer;

import java.util.Timer;
import java.util.TimerTask;

/**
 * @author haomin
 * @date 2022/05/03 18:17
 **/
public class UseTimer {
    public static void main(String[] args) {
        Timer timer = new Timer();
        TimerTask timerTask = new TimerTask() {
            @Override
            public void run() {
                System.out.println("闹钟响了");
            }
        };
        // process_demo.timer.schedule(timerTask,3000);
        timer.scheduleAtFixedRate(timerTask,1000,3000);

        while (true){}
    }
}